# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=gitg
pkgver=3.30
pkgrel=1
epoch=1
pkgdesc="GNOME GUI client to view git repositories"
url="https://wiki.gnome.org/Apps/Gitg"
arch=(x86_64)
license=(GPL)
depends=(gtksourceview3 git libgit2-glib libgee webkit2gtk libpeas gtkspell3 python-gobject)
makedepends=(intltool gobject-introspection git meson vala)
_commit=1d306388c4c8562d5225d02a737d4636fff24ccf  # tags/v3.30^0
source=("git+https://gitlab.gnome.org/GNOME/gitg.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build
  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}
